package com.neusoft.tijian.controller;

import com.neuedu.utils.JwtUtils;
import io.jsonwebtoken.Claims;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginCheckController {
    @GetMapping("/logincheck")
    public Boolean loginCheck(String jwt){
        if (jwt == null){
            return false;
        }
        jwt = jwt.replaceAll("\"","");
//        System.out.println("1");
        System.out.println(jwt);
        try {
            Claims claims = JwtUtils.parseJWT(jwt);
        }catch (Exception e){
            return false;
        }
        return true;
    }
}
